package com.softer.wxzj.common.logic;

import com.softer.wxzj.common.enums.NumStrEnum;
import com.softer.wxzj.mapper.ExpProjectReqMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**   
 * @ClassName: ExpReqLogic
 * @Description: 资金使用通用类
 * @Author:  zcz
 * @CreateDate: 2019-05-10   
 */
@Component
public class ExpReqLogic {
    @Autowired
    private ExpProjectReqMapper expProjectReqMapper;
    /**
     * 查询房屋是否处于使用中  1是  0否
     * @param id 房间id
     * @return
     */
    public String getIsExpInProgress(String id){
        //0未缴存 1已缴存
        String isExpStateInProgress = NumStrEnum.ZERO.getNum();
        int count = expProjectReqMapper.getInProgressCountByHouseId(id);
        if(count > 0){
            isExpStateInProgress = NumStrEnum.ONE.getNum();
        }
        return isExpStateInProgress;
    }

}
